﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel.Security;

namespace Pg.BioMedics.ASR.Client
{
    internal sealed class ClientCredentialsCache
    {
        #region Fields

        private static ClientCredentialsCache _instance;
        private UserNamePasswordClientCredential _credential;

        #endregion

        #region Constructors

        private ClientCredentialsCache() { }

        #endregion

        #region Properties

        internal UserNamePasswordClientCredential Credential
        {
            get
            {
                return _credential;
            }

            set
            {
                _credential = value;
            }
        }

        #endregion

        #region Static methods

        internal static ClientCredentialsCache GetInstance()
        {
            return _instance;
        }

        internal static void Create(UserNamePasswordClientCredential credential)
        {
            _instance = new ClientCredentialsCache();
            _instance._credential = credential;
        }

        internal static void Destroy()
        {
            _instance._credential = null;
        }

        #endregion
    }
}
